﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace AutomaticTester
{
    class Program
    {
        static void Main(string[] args)
        {
            Process p = new Process();
            p.StartInfo.UseShellExecute = false;
            p.StartInfo.RedirectStandardOutput = true;
            p.StartInfo.FileName = "SortFromFile.exe";
            for (int i = 1; i <= 3; ++i)
            {
                p.StartInfo.Arguments = @"file" + i.ToString() + @".txt output" + i.ToString() + @".txt";
                p.Start();
                p.WaitForExit();
                string str = p.StandardOutput.ReadToEnd();
                Console.WriteLine("*******Begin of output*******");
                Console.WriteLine(str);
                Console.WriteLine("***************End of output***************");
            }
        }
    }
}
